package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.Examine;
import com.qijian.maindata.domain.query.ExamineQuery;
import com.qijian.maindata.domain.vo.ExamineVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 检验项Mapper接口
 *
 * @author qijian
 * @date 2021-11-24
 */
public interface ExamineMapper extends BaseMapper<Examine> {

    @Select("select count(0)+IF(#{isAddOne},1,0) from main_examine WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel(boolean isAddOne);

    @Select("select count(0)+IF(#{isAddOne},1,0) from main_examine ")
    int countWithDel(boolean isAddOne);

    Page<ExamineVo> selectPageVo(Page<Examine> page, @Param(Constants.WRAPPER) Wrapper<ExamineQuery> queryWrapper);
}
